package cn.boge.hrm.client;

import cn.boge.hrm.doc.CourseDoc;
import cn.boge.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ESCourseClientFallbackFactory implements FallbackFactory<ESCourseClient> {
    @Override
    public ESCourseClient create(Throwable throwable) {
       return new ESCourseClient() {
           @Override
           public AjaxResult save(CourseDoc couresDoc) {
               throwable.printStackTrace();
               return new AjaxResult().setSuccess(false).setMessage("添加课程不可用");
           }
       };
    }
}
